<!DOCTYPE html>
<html>
<head>
    {include file='public/meta'/}
    <link rel="stylesheet" href="__STATIC_URL__/static/css/bootstrapSwitch.css">


    <link rel="stylesheet" href="__STATIC_URL__/static/css/addmchat.css"/>
    <link rel="stylesheet" href="__STATIC_URL__/static/css/creatcard.css"/>
    <link rel="stylesheet" type="text/css" href="__STATIC_URL__/static/css/bootstrap-datetimepicker.css"/>

    <script src="__STATIC_URL__/static/js/bootstrap-datetimepicker.js" type="text/javascript" charset="utf-8"></script>
    <script src="__STATIC_URL__/static/js/liandong.js" type="text/javascript" charset="utf-8"></script>
    <style>
        .filePicker{
            margin-top: -5px;
            width: 150px;
            height: 44px;
            background: #00A2D4;
            color: #fff;
            text-align: center;
            line-height: 44px;
            border-radius: 4px;
            cursor: pointer;
        }
        .file{
            position: absolute;
            left: 14px;
            top: -5px;
            width: 150px;
            height: 44px;
            line-height: 44px;
            opacity: 0;
            cursor: pointer;
        }
        .img-file{
            width: 100px;
            height: 100px;
            display: block;
            margin-left: 26px;
            margin-top: 10px;
            display: none;
        }
        .form-control{
            width: 50%;
        }
        .has-switch span, .has-switch label{
            height: auto;
        }
    </style>
</head>
<body>
{include file='public/header'/}
<!------------------导航-------------------------->
<section>
    {include file='public/left'/}
    <!--------------------------主要内容区域------------------------------------->
    <div class="content">
        <div class="page-heading mgr15 mgl15">
            <ul class="breadcrumb">
                <li>
                    当前位置是&nbsp;:&nbsp;商户信息
                </li>
                <li class="active" style="color: #02b87f;"> 营销工具</li>
            </ul>
        </div>
        <div class="panel mgr15 mgl15">
            <div class="panel-heading addCharts" style="background:#ededed;">
                新人有礼
            </div>
            <div class="panel-body">
                <div class="pull-left alert form form-area" style="width:100%; position: relative; display: block; margin-top: 0.5px;" id="form1">
                    <div class="arrow_in"></div>
                    <h4  class="card_title_detail">基本信息</h4>
                    <form class="form-horizontal adminex-form" action="" method="post">
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label"><span class="text-danger">*</span> 活动名称</label>
                            <div class="col-sm-9 col-xs-12">
                                <input type="text" class="form-control" name="rulename">
                                <div class="help-block">活动名称只用于管理，不显示给用户。 </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label"><span class="text-danger">*</span> 选择要投放的卡券</label>
                            <div class="col-sm-9 col-xs-12 coupon-color">
                                <select name="card_id" class="input-sm m-bot15 col-sm-3" >
                                    <option value="">请选择</option>
                                    <option value=""></option>
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">是否启用</label>
                            <div class="col-sm-9 col-xs-12 coupon-color">
                                <div class="controls">
                                    <div class="switch" id="share">
                                        <input type="checkbox"/>
                                        <input type="hidden" name="can_share" id="can_share" value="1">
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div style="text-align: center">
                            <button type="submit" class="btn btn-primary">添加</button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
      {include file='public/footer'/}
    </div>
</section>
</body>
<script src="/assets/merchant/js/bootstrapSwitch.js"></script>
<script src="/assets/merchant/js/commen.js" type="text/javascript" charset="utf-8"></script>
<script>
    $(function () {
        $('#myTab a:first').tab('show');
    });
</script>
<script>

    $(function () {
        $('.time').datetimepicker({
            minView: "month", //选择日期后，不会再跳转去选择时分秒
            language: 'zh-CN',
            format: 'yyyy-mm-dd',
            todayBtn: 1,
            autoclose: 1,
            todayHighlight: true,
        });
    });
    $("#share").on('switch-change', function (e, data) {
        var $el = $(data.el), value = data.value;
        if(value==true){
            $("#can_share").val(1);
        }else{
            $("#can_share").val(0);
        }
    });
    $("#give").on('switch-change', function (e, data) {
        var $el = $(data.el), value = data.value;
        if(value==true){
            $("#can_give_friend").val(1);
        }else{
            $("#can_give_friend").val(0);
        }
    });
</script>
<script type="text/javascript">
    function upload(file,typed) {
        var formData = new FormData();
        formData.append('file', $('#' + file)[0].files[0]);
        formData.append('other',file);

        $.ajax({
            url: "",
            type: 'POST',
            cache: false,
            data: formData,
            processData: false,
            contentType: false,
        }).done(function (res) {
            $("." + file).attr("src", res.savapath).css("display", "block");
            $(".file-"+file).val(res.other);
            $("."+typed+"-"+file).val(res.other);
        }).fail(function (res) {
            alert("上传失败")
        });
    }
</script>


</html>
